package com.victualler.product.department.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.victualler.core.base.dao.BaseDao;
import com.victualler.core.common.annotation.InitEditColumn;
import com.victualler.core.common.annotation.ListShowColumn;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name="department")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class DepartmentDao extends BaseDao implements Serializable {

    //机构代码
    @Column(nullable = false)
    @ListShowColumn(title = "机构代码",sort = 1)
    @InitEditColumn(title = "机构代码",sort = 1)
    private String deptNo;

    //机构名称
    @Column(nullable = false)
    @ListShowColumn(title = "机构名称",sort = 2)
    @InitEditColumn(title = "机构名称",sort = 2)
    private String name;

    //地址信息
    @ListShowColumn(title = "地址信息",sort = 3)
    @InitEditColumn(title = "地址信息",sort = 3)
    private String address;

    //备注信息
    @ListShowColumn(title = "备注信息",sort = 4)
    @InitEditColumn(title = "备注信息",sort = 4,required = false)
    private String remark;

    //父机构
    @InitEditColumn(title = "父节点",sort = 3,required = false)
    private Long parentId;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDeptNo() {
        return deptNo;
    }

    public void setDeptNo(String deptNo) {
        this.deptNo = deptNo;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
}
